/* -*- C++ -*-  vim:set syntax=cpp: 
 *
 * (C) 2004-2009 Frank-Rene Schaefer
 *
 * __QUEX_INCLUDE_GUARD__ANALYZER__ACCUMULATOR may be undefined in case
 *    that multiple lexical analyzers are used. Then, the name of the
 *    QUEX_NAME(Accumulator) must be different.                             */
#ifndef __QUEX_INCLUDE_GUARD__ANALYZER__ACCUMULATOR
#define __QUEX_INCLUDE_GUARD__ANALYZER__ACCUMULATOR


#include <quex/code_base/definitions>


QUEX_NAMESPACE_MAIN_OPEN

#   ifdef __QUEX_OPTION_PLAIN_C
    QUEX_TYPE0_ANALYZER;   
#   else
    class QUEX_TYPE0_ANALYZER;
#   endif

    /* (*) pure text accumulation and flushing */
    typedef struct {
#       ifdef QUEX_OPTION_LINE_NUMBER_COUNTING
        size_t  _begin_line;
#       endif
#       ifdef QUEX_OPTION_COLUMN_NUMBER_COUNTING
        size_t  _begin_column;
#       endif

        struct { 
            QUEX_TYPE_CHARACTER* begin;
            QUEX_TYPE_CHARACTER* end;
            QUEX_TYPE_CHARACTER* memory_end;
        }                   text;
        QUEX_TYPE_ANALYZER* the_lexer;     

    } QUEX_NAME(Accumulator);

    QUEX_INLINE void
    QUEX_NAME(Accumulator_init_memory)(QUEX_NAME(Accumulator)*   me);

    QUEX_INLINE void
    QUEX_NAME(Accumulator_construct)(QUEX_NAME(Accumulator)*, QUEX_TYPE_ANALYZER*);

    QUEX_INLINE void
    QUEX_NAME(Accumulator_destruct)(QUEX_NAME(Accumulator)* me);

    QUEX_INLINE bool
    QUEX_NAME(Accumulator_extend)(QUEX_NAME(Accumulator)* me, size_t MinAddSize);

    QUEX_INLINE void
    QUEX_NAME(Accumulator_clear)(QUEX_NAME(Accumulator)* me);

    QUEX_INLINE void 
    QUEX_NAME(Accumulator_add)(QUEX_NAME(Accumulator)*    me,
                               const QUEX_TYPE_CHARACTER* Begin, const QUEX_TYPE_CHARACTER* End);

    QUEX_INLINE void 
    QUEX_NAME(Accumulator_add_character)(QUEX_NAME(Accumulator)*     me,
                                         const QUEX_TYPE_CHARACTER  Character);

    QUEX_INLINE void  
    QUEX_NAME(Accumulator_print_this)(QUEX_NAME(Accumulator)* me);

QUEX_NAMESPACE_MAIN_CLOSE

#endif /* __QUEX_INCLUDE_GUARD__ANALYZER__ACCUMULATOR */
